﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MvcEngine.Core.Validation;
using MvcEngine.Core.Base;

namespace MvcEngine.Core.Content
{
    public class Module : Entity
    {
        public Guid Id { get; set; }

        [RequiredFieldValidator("$RequiredValidator")]
        [LengthValidator("$LengthValidator", 256)]
        public string Name { get; set; }

        [LengthValidator("$LengthValidator", 256)]
        public string Description
        {
            get { return GetValue<string>("Description", string.Empty); }
            set { Fields.SetValue("Description", value); }
        }

        public bool ShowInBackOfficeMenu
        {
            get { return GetValue<bool>("ShowInBackOfficeMenu", false); }
            set { Fields.SetValue("ShowInBackOfficeMenu", value); }
        }

        [RequiredFieldValidator("$RequiredValidator")]
        [LengthValidator("$LengthValidator", 50)]
        public string Version { get; set; }

        public bool IsInstallable { get; set; }

        public bool OnePerPage { get; set; }

        public override string Xml { get; set; }

        public Guid? CreatedBy { get; set; }

        public DateTime CreatedDate { get; set; }

        public Guid? ModifiedBy { get; set; }

        public DateTime ModifiedDate { get; set; }
    }
}
